import request from '@/utils/request'

// 查询App用户列表
export function listUser(query) {
  return request({
    url: '/app/user/list',
    method: 'get',
    params: query
  })
}

// 查询App用户详细
export function getUser(id) {
  return request({
    url: '/app/user/' + id,
    method: 'get'
  })
}

/**
 * App账户重置密码，
 * @param {*} id
 * @returns
 */
export function reset(id){
  return request({
    url:'/app/user/reset/' + id,
    method: 'put'
  })
}

/**
 * 获取用户车辆信息
 * @param {*} query
 * @returns
 */
export function getUserVehicleList(query){
  return request({
    url:'/app/user/getUserVehicle',
    method:'get',
    params:query
  })
}

// 用户状态修改
export function changeAppUserStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/app/user/changeStatus',
    method: 'put',
    data: data
  })
}

/**
 * 获取用户紧急联系人
 * @param {*} query
 * @returns
 */
export function getUserEmergencyList(query){
  return request({
    url:'/app/user/getUserEmergency',
    method:'get',
    params:query
  })
}

// 删除App用户
export function delUser(id) {
  return request({
    url: '/app/user/' + id,
    method: 'delete'
  })
}
